package com.xiangban.controller;

import com.xiangban.aop.Permission;
import com.xiangban.model.AccompanyInvite;
import com.xiangban.model.dto.AccompanyDto;
import com.xiangban.model.res.ApiResult;
import com.xiangban.service.AccompanyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ly
 * @date 2021/12/8 10:25
 */
@RestController
@Api("陪诊认证控制器")
@RequestMapping("/api/accompany")
public class AccompanyController {
    @Autowired
   private AccompanyService accompanyService;
    @ApiOperation("陪诊认证")
    @PostMapping("/accompanyAttestation")
    @Permission
    public ApiResult<Object> accompanyAttestation(@RequestBody AccompanyDto accompanyDto) throws Exception {

        return ApiResult.newSuccess(accompanyService.accompanyAttestation(accompanyDto));
    }
    @ApiOperation("陪诊员中心")
    @PostMapping("accompany_centre")
    @Permission
    public ApiResult<Object>  accompanyCentre(){

      return ApiResult.newSuccess(accompanyService.accompanyCentre());
    }
    @ApiOperation("钱包详情")
    @PostMapping("wallet_details")
    @Permission
    public ApiResult<Object> walletDetails(){

        return ApiResult.newSuccess(accompanyService.walletDetails());
    }
    @ApiOperation("余额明细")
    @PostMapping("remaining_balance")
    @Permission
    public ApiResult<Object> remainingBalance(){//id
        return ApiResult.newSuccess(accompanyService.remainingBalance());
    }
    @ApiOperation("余额明细五条记录")
    @PostMapping("five_details")
    @Permission
    public ApiResult<Object> fiveDetails(){
        return ApiResult.newSuccess(accompanyService.fiveDetails());

    }
    @ApiOperation("陪诊邀请记录")
    @PostMapping("invited_to_record")
    @Permission
    public ApiResult<Object> invitedToRecord(@RequestBody AccompanyInvite accompanyInvite){

        return ApiResult.newSuccess(accompanyService.invitedToRecord(accompanyInvite));
    }
}
